import 'package:flutter/material.dart';
import 'dart:async';

//加载页面
class LoadingPage extends StatefulWidget{
  @override
  _LoadingState createState()=>new _LoadingState();

}

class _LoadingState extends State<LoadingPage>{
  
  @override
  void initState(){
     super.initState();
     new Future.delayed(Duration(seconds: 3),(){
        print("Flutter 即时通讯APP界面实现...");
        Navigator.of(context).pushReplacementNamed("login");
     });
  }
  
  @override
  Widget build(BuildContext context) {
    return new Center(
       child:Stack(children: <Widget>[
         //加载页面剧中背景图，使用cover模式
         Image.asset("images/loading.jpeg",fit: BoxFit.cover,)
       ],),
    );
  }
}